import request from "/@/utils/request"
import {FetchWmsListData, IdArray, Location, WmsWarehouse} from './apiTypes'; // 用实际的文件路径替换
import { AnyColumn } from "element-plus/es/components/table-v2/src/common";

/**
 * 获取仓库列表
 * @param data
 */
export function fetchWarehouseList(data?: FetchWmsListData) {
    return request({
        url: '/wms/warehouse/QueryWarehouse',
        method: 'post',
        data: data
    })
}

/**
 * 添加仓库
 * @param data
 */
export function addWarehouse(data?: WmsWarehouse) {
    return request({
        url: '/wms/warehouse/AddWarehouse',
        method: 'post',
        data: data
    })
}

/**
 * 更新仓库
 * @param data
 */
export function updateWarehouse(data?: WmsWarehouse) {
    return request({
        url: '/wms/warehouse/UpdateWarehouse',
        method: 'post',
        data: data
    })
}

/**
 * 删除仓库
 * @param id
 */
export function delWarehouse(data?: IdArray) {
    return request({
        url: `/wms/warehouse/DelWarehouseById`,
        method: 'post',
        data: data
    })
}

/**
 * 根据id获取库位列表
 * @param obj
 */
export function getLocationList(obj?: Object) {
    return request({
        url: '/wms/warehouse/QueryLocation',
        method: 'post',
        data: obj
    })
}

/**
 * 添加库位信息
 * @param obj
 */
export function addLocation(obj?: Location) {
    return request({
        url: '/wms/warehouse/AddLocation',
        method: 'post',
        data: obj
    })
}

/**
 * 更新库位信息
 * @param obj
 */
export function updateLocation(obj?: Location) {
    return request({
        url: '/wms/warehouse/UpdateLocationById',
        method: 'post',
        data: obj
    })
}

/**
 * 删除库位信息
 */
export function delLocation(idArray: any) {
    return request({
        url: `/wms/warehouse/DelLocationByid`,
        method: 'post',
        data: idArray
    })
}

/**
 * 获取物料容量列表
 * @param obj
 */
export function getMaterialCapacityList(obj?: Location) {
    return request({
        url: '/wms/warehouse/GetMaterialCapacityList',
        method: 'post',
        data: obj
    })
}

/**
 * delete RM库位容量
 * @param obj
 */
export function deleteMaterialCapacity(obj?: Location) {
    return request({
        url: '/wms/warehouse/DeleteMaterialCapacity',
        method: 'post',
        data: obj
    })
}

/**
 * 插入 RM库位容量
 * @param obj
 */
export function insertMaterialCapacity(obj?: Location) {
    return request({
        url: '/wms/warehouse/InsertMaterialCapacity',
        method: 'post',
        data: obj
    })
}

/**
 * 更新 RM库位容量
 * @param obj
 */
export function updateMaterialCapacity(obj?: Location) {
    return request({
        url: '/wms/warehouse/UpdateMaterialCapacity',
        method: 'post',
        data: obj
    })
}